package com.hlkj.baojin.entity;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

@Document
@Getter
@Setter
public class RealData implements Serializable {
    @Id
    private String id;
    //公司id
    private String deptId;
    //设备id
    private String deviceId;
    //实时数据
    private Double real;
    //数据单位
    private String realUnit;
    //true 正常  false.报警
    private boolean realStatus;

    //0 正常 1.设备异常
    private Integer status;
    //刷新时间
    private long updateTime;

    public RealData() {
    }
    public RealData( String deptId, String deviceId, Double real, String realUnit, Integer status,Boolean realStatus,Long updateTime) {
        this.id = deviceId;
        this.deptId = deptId;
        this.deviceId = deviceId;
        this.real = real;
        this.realUnit = realUnit;
        this.status = status;
        this.updateTime = updateTime;
        this.realStatus=realStatus;
    }

    public void filterReal() {
        this.real = null;
        this.realUnit = null;
        this.realStatus=false;
    }
}
